<#include "/WEB-INF/view/common/_layout.html"/>
<@layout>
<!-- 一级菜单 -->
<div ng-controller="navberCtrl" >
<nav id='primaryNavbar'>
  <ul class='nav nav-stacked'>
	  <li ng-class="{active:isSelectRoot('home')}" data-id='home'><a data-toggle='tooltip' data-placement='right' ng-click="selectRoot('home')" ui-sref="home" title='首页'><i class='icon icon-home'></i></a></li>
  	  <#list session.getAttribute("SESSION_AUTH_POWER") as powerOne>
			<#if powerOne.father_id =='0'>
			  <li ng-class="{active:isSelectRoot('${powerOne.permission}')}"  data-id='${powerOne.permission!}'><a data-toggle='tooltip' data-placement='right' ng-click="selectRoot('${powerOne.permission!}')" href='#' title='${powerOne.power_name!}'><i class='${powerOne.ico!}'></i></a></li>
			</#if>
      </#list>
  </ul>
  
  <ul class="nav nav-stacked fixed-bottom">
  	<li data-toggle="tooltip" data-placement='right' title="${session.SESSION_USER_KEY.user_name!}" data-id="profile" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon icon-user"></i><span class="text-username"> ${session.SESSION_USER_KEY.user_name!} <b class="caret"></b></span></a>
	  	<ul class="dropdown-menu">
	  		<li class="heading"><i class="icon icon-large"><img src='${req.contextPath+session.SESSION_USER_KEY.image!}' /></i>
	  		<strong> ${session.SESSION_USER_KEY.user_name!}</strong></li>
	  		<li class="divider"></li><li><a href='#' ng-click='modPassword()'>修改密码</a></li>
			<li><a href='#' ng-click='logout()' >退出</a></li>
		</ul>
	</li>
  </ul>
</nav>

<!-- 二级菜单 -->
<nav class='navbar navbar-fixed-top' role='navigation' id='mainNavbar'>
  <div class='collapse navbar-collapse' id='mainNavbarCollapse'>
		<ul class='nav navbar-nav' ng-show="isSelectRoot('home')">
 			<li ng-class="{active:isSelectChild('home_index')}" ><a ng-click="selectChild('home_index','home')" ui-sref="home" ui-sref-opts="{reload: true}" >文档管理</a></li>
		</ul>
		
       <#list session.getAttribute("SESSION_AUTH_POWER") as powerOne>
			<#if powerOne.father_id =='0'>
				<#if powerOne.root !=1> <!--二级菜单 -->
    			<ul class='nav navbar-nav' ng-show="isSelectRoot('${powerOne.permission}')">
    				<#list session.getAttribute("SESSION_AUTH_POWER") as powerTwo>
    					<#if powerOne.id == powerTwo.father_id>
    					<li ng-class="{active:isSelectChild('${powerTwo.permission}')}" ><a ng-click="selectChild('${powerTwo.permission!}','${powerOne.permission!}')" ui-sref="${powerTwo.url!}" ui-sref-opts="{reload: true}" >${powerTwo.power_name!}</a></li>
						</#if>
					 </#list>
    			</ul>
				</#if>
			</#if>
        </#list>
        
    	<ul class='nav navbar-nav navbar-right'>
      		<li><a href='${req.contextPath}/index.do' target='_blank' class='navbar-link'><i class="icon icon-columns"></i> 文档展示</a></li>
    	</ul>
  </div>
</nav>
</div>
</@layout>